package com.ruoyi.yipaiju.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yipaiju.mapper.QaMapper;
import com.ruoyi.yipaiju.domain.Qa;
import com.ruoyi.yipaiju.service.IQaService;

/**
 * fo_qaService业务层处理
 * 
 * @author liuwp
 * @date 2023-03-01
 */
@Service
public class QaServiceImpl implements IQaService 
{
    @Autowired
    private QaMapper qaMapper;

    /**
     * 查询fo_qa
     * 
     * @param id fo_qa主键
     * @return fo_qa
     */
    @Override
    public Qa selectQaById(Long id)
    {
        return qaMapper.selectQaById(id);
    }

    /**
     * 查询fo_qa列表
     * 
     * @param qa fo_qa
     * @return fo_qa
     */
    @Override
    public List<Qa> selectQaList(Qa qa)
    {
        return qaMapper.selectQaList(qa);
    }

    /**
     * 根据业务主键查询一条记录：fo_qa
     *
     * @param qa fo_qa
     * @return fo_qa
     */
    @Override
    public Qa selectOneQa(Qa qa)
    {
        return qaMapper.selectOneQa(qa);
    }

    /**
     * 新增fo_qa
     * 
     * @param qa fo_qa
     * @return 结果
     */
    @Override
    public int insertQa(Qa qa)
    {
        qa.setCreateTime(DateUtils.getNowDate());
        return qaMapper.insertQa(qa);
    }

    /**
     * 修改fo_qa
     * 
     * @param qa fo_qa
     * @return 结果
     */
    @Override
    public int updateQa(Qa qa)
    {
        qa.setUpdateTime(DateUtils.getNowDate());
        return qaMapper.updateQa(qa);
    }

    @Override
    public int updateQaCondition(Qa qa, Qa qaCondition)
    {
                qa.setUpdateTime(DateUtils.getNowDate());
        return qaMapper.updateQaCondition(qa, qaCondition);
    }

    /**
     * 批量删除fo_qa
     * 
     * @param ids 需要删除的fo_qa主键
     * @return 结果
     */
    @Override
    public int deleteQaByIds(Long[] ids)
    {
        return qaMapper.deleteQaByIds(ids);
    }

    /**
     * 删除fo_qa信息
     * 
     * @param id fo_qa主键
     * @return 结果
     */
    @Override
    public int deleteQaById(Long id)
    {
        return qaMapper.deleteQaById(id);
    }

    /**
     * 条件删除fo_qa
     *
     * @param qa fo_qa
     * @return 结果
     */
    @Override
    public int deleteQaByCondition(Qa qa)
    {
        return qaMapper.deleteQaByCondition(qa);
    }

}
